package com.jtny.nytb.config.measurementtype.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.jtny.component.enums.GenericStatusEnum;
import com.jtny.nytb.config.measurementtype.dto.MeasurementTypeDTO;
import lombok.Data;

@Data
@ExcelIgnoreUnannotated
public class ExcelMeasurementTypeVO {
    @ExcelProperty("计量单位分类编号")
    @ColumnWidth(30)
    String code;


    @ExcelProperty("计量单位分类名称")
    @ColumnWidth(30)
    private String name;

    public MeasurementTypeDTO toBuildDto() {
        MeasurementTypeDTO measurementTypeDTO = new MeasurementTypeDTO();
        measurementTypeDTO.setCode(this.code);
        measurementTypeDTO.setName(this.name);
        measurementTypeDTO.setStatus(GenericStatusEnum.NORMAL.getValue());
        return measurementTypeDTO;
    }
}
